let Openai = require("openai");

let openai = new Openai({
  baseURL: "http:127.0.0.1:11434/v1",
  apiKey: "ollama",
});

async function chatai(prompt) {
  let res = await openai.chat.completions.create({
    model: "deepseek-r1:1.5b",
    messages: [
      {
        role: "user",
        content: prompt, // 这里是你要问的问题，你可以修改为你想要问的任何问题
      },
    ],
    stream: true,
  });
  return res;
}

module.exports = {
  chatai,
};
